<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<%@include file="/WEB-INF/view/common/common.jsp" %>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link href="${ctx}/resources/mallcss/initcss.css" rel="stylesheet">
    <link href="${ctx}/resources/mallcss/common.css" rel="stylesheet">
    <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <style type="text/css">

    </style>
    <title>转账</title>
    <head>
<body style="background: rgb(232, 232, 232);">
<div>
    <p style="font-size: 18px; text-align: center;margin-top: 10px">奖金钱包转入现金钱包</p>
</div>
<hr/>
<div>
    <div style="text-align: center">
        <p style="font-size: 12px;color: #7d0000">1:1转换</p>
        <p style="font-size: 12px;color: #7d0000">扣除10%手续费</p>
    </div>

    <div style="text-align: center;padding-top: 50px;">
        <form>
            <p>转账金额：<input id="zzje" style="padding-top:6px;width:220px;line-height: 20px;padding-left: 6px;" type="text" placeholder="例如：200" /></p><br/>
            <button style="width: 100px;font-size: 16px;line-height: 26px;" id="btnTX"><strong>确认转账</strong></button>
        </form>
    </div>
</div>
<script type="text/javascript" src="${ctx}/resources/lottery/js/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script src="http://apps.bdimg.com/libs/jquery-qrcode/1.0.0/jquery.qrcode.min.js"></script>
<script>
    $(function () {
        $("#btnTX").on('click', function () {
            var zzje = document.getElementById("zzje").value;
            if(zzje == "" && zzje.length == 0){
                alert("请输入转账金额!");
            }else{
                var bonus= ${MyBonus};
                if(zzje > bonus){
                    alert("您目前最多能转出："+ bonus +"元!");
                }else{
                    var url = "<c:url value="/mobile/jzxJson.json" />";
                    if (confirm("温馨提示：确认转账后无法撤销，请谨慎合理操作。确认转账吗？")) {
                        $.ajax({
                            url: url,
                            type: 'get',
                            data: {
                                zzje : zzje
                            },
                            dataType: 'json',
                            success: function (data) {
                                <%--if(data.flag == 0){--%>
                                <%--alert("提现成功!");--%>
                                <%--window.location.href = "<c:url value="/mobile/cashRecord.html"/>";--%>
                                <%--}else {--%>
                                <%--alert("提现失败!请核对数据后再操作或联系管理员。");--%>
                                <%--}--%>
                            }
                        });
                    }
                    alert("转账成功！");
                    window.location.href="<c:url value="/mobile/accounts/records.html?stateType=4"/>";
                }
            }
        });
    });
</script>
</body>

</html>
